import cameraModule from "./camera";
import rendererModule from "./renderer";
// 更新摄像头的长宽比
cameraModule.activeCamera.aspect = window.innerWidth / window.innerHeight;
// 更新摄像机的投影矩阵
cameraModule.activeCamera.updateProjectionMatrix()
// 监听屏幕大小改变的变化，设置渲染的尺寸
window.addEventListener('resize', () => {
    cameraModule.activeCamera.aspect = window.innerWidth / window.innerHeight
    cameraModule.activeCamera.updateProjectionMatrix()

    // 更新渲染器
    rendererModule.renderer.setSize(window.innerWidth, window.innerHeight)
    rendererModule.css3drenderer.setSize(window.innerWidth, window.innerHeight)
    // 设置渲染器的像素比例
    rendererModule.renderer.setPixelRatio(window.devicePixelRatio)
    rendererModule.css3drenderer.setPixelRatio(window.devicePixelRatio)
.setPixelRatio(window.devicePixelRatio)
})